package com.sharemarking.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sharemarking.system.dto.receipt.ReceiptListDto;
import com.sharemarking.wa.common.entity.Receipt;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @author dxy
 */
@Repository
public interface ReceiptMapper extends BaseMapper<Receipt> {
    List<ReceiptListDto> getReceiptList(Map map);

    Integer  getReceiptListTotal(Map map);

    @Select("SELECT pay_record_id FROM sys_receipt_pay_record WHERE id = #{id}")
    List<Integer> getPayRecordId(Integer id);

    @Update("UPDATE sys_pay_record SET is_receipt = 2 WHERE id = #{id} ")
    void updatePayRecordState(Integer id);
}
